<template>
  <!--医生信息页面-->
  <el-container class="doctorInfo">
    <el-aside style="width: 200px;margin-top: 20px">
      <switch></switch>
      <SideMenu @selectIndex="listByCategory" ref="sideMenu"></SideMenu>
    </el-aside>
    <el-main>
      <doctors class="doctors-area" ref="doctorsArea"></doctors>
    </el-main>
  </el-container>

  <!--/医生信息页面-->

</template>

<script>
import waitingQueue from "../waitingQueue/waitingQueue";
import SideMenu from "../comp/SideMenu"
import Doctors from "../comp/doctors"
export default {
  name: "doctorInfo",
  components: {SideMenu, Doctors},
  data() {
    return{

    }
  },methods: {
    listByCategory(){
      const self = this;
      let departName = this.$refs.sideMenu.departName;
      //当为1时即点击了全部
      let body={
        method: departName !== '1' ? 'departmentName' : 'all' ,
        params: {'departmentName': departName }
      }
      this.$axios
          .post('api/doctor/findDoctorInfo',body)
          .then(res=>{
            self.$refs.doctorsArea.doctors = res.data.data
          }).catch(err=>{console.log(err)})


    }
  }

}
</script>

<style scoped>
  .doctors-area {
    width: 990px;
    margin-left: auto;
    margin-right: auto;
  }

</style>